package sebastiankerckhof.structure.math;

import java.io.Serializable;

public class Point3f extends Tuple3f implements Serializable
{
		public static final Point3f ORIGIN = new Point3f();
	
    /**
     * Constructs and initializes a Point3f to (0,0,0).
     */

    public Point3f()
    {
    }


    /**
     * Constructs and initializes a Point3f from the specified xyz coordinates.
     * @param x
     * @param y
     * @param z
     */
    public Point3f(float x, float y, float z)
    {
        super(x, y, z);
    }


    /**
     * Constructs and initializes a Point3f from the specified Point3f.
     * @param p
     */

    public Point3f(Point3f p)
    {
        super(p);
    }


    /**
     * Constructs and initializes a Point3f from the specified Tuple3f.
     * @param t
     */

    public Point3f(Tuple3f t)
    {
        super(t);
    }


    /**
     * Constructs and initializes a Point3f from the array of length 3.
     * @param p
     */

    public Point3f(float p[])
    {
        super(p);
    }
    
    
    public Point3f add(Tuple3f o){ return plus(o); }
    public Point3f plus(Tuple3f o) {
	    return new Point3f(this.x + o.x, this.y + o.y, this.z + o.z);
    }

    public Vector3f subtract(Point3f p){
    	return new Vector3f(this.x - p.x, this.y - p.y, this.z - p.z);
    }

}
